﻿var Kuler = new function () {
    /*
    To create new set:
    http://colorschemedesigner.com/
    var a=[]; $(".code").each(function(){ a.push('#' + $(this).html()); }); a;
    */
    //var colorSet = ["#04819E", "#206676", "#015367", "#38B2CE", "#60B9CE", "#1435AD", "#2C3E82", "#071D70", "#4867D6", "#6E84D6", "#FFB100", "#BF9430", "#A67300", "#FFC540", "#FFD473", "#FF7F00", "#BF7730", "#A65200", "#FF9F40", "#FFB873"];
    //var colorSet = ["#CC8E6A", "#997662", "#854623", "#E6B193", "#E6BFA9", "#CCA06A", "#998062", "#855823", "#E6C093", "#E6CAA9", "#476D82", "#405661", "#173F54", "#7FA9C0", "#90B0C0", "#468674", "#40645A", "#175745", "#7CC2AF", "#8FC2B4"];
    //var colorSet = ["#419479", "#42826D", "#287B60", "#59AF93", "#63AF96", "#56509B", "#534F88", "#383280", "#6E68B4", "#7671B4", "#DFC262", "#C3AD64", "#B89C3D", "#E7CD76", "#E7D083", "#DF8C62", "#C38464", "#B8663D", "#E79C76", "#E7A583"];
    //var colorSet = ["#C8D95F", "#B1BE61", "#A2B33B", "#D3E273", "#D5E280", "#DF7E62", "#C37964", "#B8583D", "#E78F76", "#E79983", "#51549B", "#4F5288", "#323680", "#686CB4", "#7174B4"];
    //var colorSet = ["#DFDF62", "#C3C364", "#B8B83D", "#E7E776", "#E7E783", "#55B550", "#559E51", "#369531", "#6AC766", "#75C771", "#DFB662", "#C3A464", "#B8903D", "#E7C276", "#E7C683", "#794695", "#6D4682", "#5F2B7B", "#935EAF", "#9667AF"];
    var colorSet = ["#3D8B82", "#3E7973", "#26726A", "#56A89F", "#5FA8A0", "#44708F", "#44657D", "#2A5776", "#5C8BAB", "#658EAB", "#469F6D", "#478B65", "#2B8352", "#5DB784", "#68B78A"];
    //var colorSet = ["#8F753F", "#7D6940", "#765C27", "#AB8F57", "#AB9361", "#8F7C3F", "#7D6E40", "#766327", "#AB9757", "#AB9961", "#8F6D3F", "#7D6340", "#765427", "#AB8757", "#AB8B61"];

    var remainingColors = null;
    this.FetchNextColor = function () {
        if (remainingColors == null || remainingColors.length == 0)
            remainingColors = $.extend([], colorSet);
        var nextColorIndex = Math.round(Math.random() * (remainingColors.length - 1));
        return String(remainingColors.splice(nextColorIndex, 1));
    };
};